import App from './App'
import uView from '@/uni_modules/uview-ui'
import config from "@/server/config.js"
import moment from 'moment'
moment.locale('zh-cn')

Vue.use(uView);

// #ifndef VUE3
import Vue from 'vue';
import './uni.promisify.adaptor'
import {
	toPages,
	toBack,
	toPagesIslogin,
	islogin
} from './util/index.js'
import {
	isEmpty,
	isAllWhitespace
} from './util/helper.js'

Vue.config.productionTip = false
Vue.prototype.toPages = toPages;
Vue.prototype.toPagesIslogin = toPagesIslogin;
Vue.prototype.toBack = toBack;
Vue.prototype.isEmpty = isEmpty;
Vue.prototype.islogin = islogin;
Vue.prototype.isAllWhitespace = isAllWhitespace;

/**
 * @param {Number} timestamp_seconds 秒数时间戳
 */
Vue.prototype.momentFormat = (timestamp_seconds, format = 'YYYY-MM-DD HH:mm:ss') => {
	return moment.unix(timestamp_seconds).format(format)
};



App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif